<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">  
<title>河北大学专利协同服务平台</title>
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/H-ui.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/login.css">
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
	$(document)
			.ready(
					function() {
						$("#sumbit")
								.click(
										function() {
											var message = $("#message");
											message
													.html("<font color='red'></font>");
											var phoneNumber = $("#phoneNumber")
													.val();
											var password = $("#password").val();
											if (phoneNumber != ""
													&& phoneNumber != null
													&& password != ""
													&& password != null) {
												$
														.ajax({
															type : "POST",
															url : "${pageContext.request.contextPath}/researcher/login.html",
															data : $("#form")
																	.serialize(),
															dataType : 'text',
															success : function(
																	data) {
																if (data == "success") {
																	window.location = '${pageContext.request.contextPath}/patent/topatentlist.action';
																} else if (data == "fail") {
																	message
																			.html("<font color='red'>手机号或密码不正确!</font>");
																}
															}
														});
											} else if ((phoneNumber == "" || phoneNumber == null)
													&& (password == "" || password == null)) {
												message
														.html("<font color='red'>请输入手机号和密码！</font>");
											} else if (password == ""
													|| password == null) {
												message
														.html("<font color='red'>请输入密码！</font>");
											} else if (phoneNumber == ""
													|| phoneNumber == null) {
												message
														.html("<font color='red'>请输入手机号！</font>");
											}
										});
					});
</script>
<style type="text/css">
.logo {
	margin-left:-40px;
	margin-top:-22px;
	background:
		url('${pageContext.request.contextPath}/images/index_logo.png')
		no-repeat;
}
</style>
</head>
<body>
	<div id="contain" class="c_contain">
		<div id="top" class="c_top">
			<img alt="logo"
				src="${pageContext.request.contextPath}/images/index_logo.png"
				class="logo">
			<!-- 标题文字 -->
		</div>
		<div id="center" class="c_center">
			<div class="tb_border">
				<h1 align="center">账号登录</h1>
				<hr class="center_hr" />
				<form id="form">
					<table id="tb" class="c_tb">
						<tr align="left">
							<th>手机:</th>
						</tr>
						<tr>
							<td><input type="text" class="c_phoneNumber"
								id="phoneNumber" name="phoneNumber" /></td>
						</tr>
						<tr align="left">
							<th>密码:</th>
						</tr>
						<tr>
							<td><input type="password" class="c_password" id="password"
								name="password" /></td>
						</tr>
						<tr align="right">
							<td colspan="2"><span id="message"
								style="text-align: left; font-size: 14px; display: block; float: left; width: 230px;"></span>
								<a
								href="${pageContext.request.contextPath}/redirect/toForget.html"
								style="color: #666666; text-decoration: none; font-size: 15px; margin-right: 10px;">
									忘记密码</a></td>
						</tr>
						<tr>
							<td colspan="2" class="submit_td"><input id="sumbit"
								class="btn btn-primary" type="button"
								value="&nbsp;&nbsp;登录&nbsp;&nbsp;"></td>
						</tr>
						<tr align="right">
							<td colspan="2"><a
								href="${pageContext.request.contextPath}/researcher/toRegist.html"
								style="color: #B61D1D; text-decoration: none; font-size: 15px; margin-right: 10px;">
									>>立即注册</a></td>
						</tr>
					</table>
				</form>
			</div>
		</div>
		<div id="floor" class="c_floor"></div>
	</div>
</body>
</html>